<%@ page import="apralms.Scheme" %>



<div class="fieldcontain ${hasErrors(bean: schemeInstance, field: 'code', 'error')} required">
	<label for="code">
		<g:message code="scheme.code.label" default="Code" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="code" maxlength="10" required="" value="${schemeInstance?.code}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: schemeInstance, field: 'name', 'error')} required">
	<label for="name">
		<g:message code="scheme.name.label" default="Name" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="name" maxlength="50" required="" value="${schemeInstance?.name}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: schemeInstance, field: 'project', 'error')} required">
	<label for="project">
		<g:message code="scheme.project.label" default="Project" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="project" name="project.id" from="${apralms.Project.list()}" optionKey="id" required="" value="${schemeInstance?.project?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: schemeInstance, field: 'calMode1', 'error')} required">
	<label for="calMode">
		<g:message code="scheme.calMode1.label" default="Cal Mode 1" />
		<span class="required-indicator">*</span>
	</label>
	<g:select name="calMode1" from="${schemeInstance.constraints.calMode1.inList}" required="" value="${schemeInstance?.calMode1}" valueMessagePrefix="scheme.calMode"/>
</div>

<div class="fieldcontain ${hasErrors(bean: schemeInstance, field: 'calMode2', 'error')} required">
	<label for="calMode2">
		<g:message code="scheme.calMode2.label" default="Cal Mode 2" />
		<span class="required-indicator">*</span>
	</label>
	<g:select name="calMode2" from="${schemeInstance.constraints.calMode2.inList}" required="" value="${schemeInstance?.calMode2}" valueMessagePrefix="scheme.calMode"/>
</div>

<div class="fieldcontain ${hasErrors(bean: schemeInstance, field: 'runTime', 'error')} required">
	<label for="runTime">
		<g:message code="scheme.runTime.label" default="Run Time" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="number" name="runTime" min="0.0" max="10000.0" required="" value="${fieldValue(bean: schemeInstance, field: 'runTime')}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: schemeInstance, field: 'projectIndexes', 'error')} ">
	<label for="projectIndexes">
		<g:message code="scheme.projectIndexes.label" default="Project Indexes" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${schemeInstance?.projectIndexes?}" var="p">
    <li><g:link controller="projectIndex" action="show" id="${p.id}">${p?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="projectIndex" action="create" params="['scheme.id': schemeInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'projectIndex.label', default: 'ProjectIndex')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: schemeInstance, field: 'systemIndexes', 'error')} ">
	<label for="systemIndexes">
		<g:message code="scheme.systemIndexes.label" default="System Indexes" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${schemeInstance?.systemIndexes?}" var="s">
    <li><g:link controller="systemIndex" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="systemIndex" action="create" params="['scheme.id': schemeInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'systemIndex.label', default: 'SystemIndex')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: schemeInstance, field: 'productIndexes', 'error')} ">
	<label for="productIndexes">
		<g:message code="scheme.productIndexes.label" default="Product Indexes" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${schemeInstance?.productIndexes?}" var="p">
    <li><g:link controller="productIndex" action="show" id="${p.id}">${p?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="productIndex" action="create" params="['scheme.id': schemeInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'productIndex.label', default: 'ProductIndex')])}</g:link>
</li>
</ul>

</div>